﻿namespace ConsoleApp;
//using System.Reactive.Subjects;

public class DemoReactive
{
    public static void Main()
    {
        // // 创建一个 Subject，它既是 IObservable 也是 IObserver
        // var subject = new Subject<string>();
        //
        // // 订阅数据流
        // subject.Subscribe(
        //     onNext: value => Console.WriteLine($"Received: {value}"),
        //     onError: error => Console.WriteLine($"Error: {error.Message}"),
        //     onCompleted: () => Console.WriteLine("Completed")
        // );
        //
        // // 发布数据
        // subject.OnNext("Hello");
        // subject.OnNext("Reactive Extensions");
        // subject.OnCompleted();
    }
}